﻿using System.Runtime.InteropServices;

namespace SilverlightViewport.Common.Interop
{
    [ComImport]
    [Guid("1B36028E-B491-4bb2-8584-8A9E0A677D6E")]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IXcpControlHost
    {
        [return: MarshalAs(UnmanagedType.U4)]
        uint GetHostOptions();
        void NotifyLoaded();
        void NotifyError([In, MarshalAs(UnmanagedType.BStr)] string strFilename, [In, MarshalAs(UnmanagedType.BStr)] string bstrSource, [In] int nLine, [In] int nColumn);
        [return: MarshalAs(UnmanagedType.IUnknown)]
        object InvokeHandler([In, MarshalAs(UnmanagedType.BStr)] string bstrName, [In] object varArg1, [In] object varArg2);
        [return: MarshalAs(UnmanagedType.BStr)]
        string GetBaseUrl();
        [return: MarshalAs(UnmanagedType.BStr)]
        string GetNamedSource([In, MarshalAs(UnmanagedType.BStr)] string bstrSourceName);
        [PreserveSig]
        int DownloadUrl([In, MarshalAs(UnmanagedType.BStr)] string bstrUrl, [In, MarshalAs(UnmanagedType.Interface)] IXcpControlDownloadCallback pCallback, [Out, MarshalAs(UnmanagedType.Interface)] out IStream ppStream);
    }
}
